*==============================================================================
*==============================================================================
*=     File-Name:      UnitProliferationAnalysis.do                          == 
*=     Date:           03/09/2026                                            ==
*=     Author:         Murat Abus (muabus@syr.edu)                           ==
*=     Purpose:        Analysis in Abus and Ciftci (Electoral Studies 2026)  == 
*=     Input File 1:   UnitProliferation.dta                                 ==
*=     Software:       Stata/BE 19                                           ==
*=     Machine:        MacBook Air M4                                        == 
*=     System:         MacOS 26.3 Tahoe                                      ==
*==============================================================================
*==============================================================================
 
version 19 
clear
pwd	
*capture log close
set more off

// Set the working directory
cd "...."

// Load data
use "UnitProliferation.dta", clear

// Defining the panel structure of the data: 
xtset district_id year  

xttab split
xtsum split

// Descriptive Statistics Table (Table 1)
summ single coal incum_bef_dist coal_part coal_dist disprop margin lagright splitbefore evolatlag1 ruralshare age kurddist ethnicparty lnpop trend gdpgrowth


// Define global

global CONTROLS evolatlag1 disprop margin lagright splitbefore ruralshare kurddist ethnicparty lnpop age trend
global CONTROLCLUSTER evolatlag1 disprop margin lagright splitbefore ruralshare kurddist ethnicparty lnpop age


// Results Table (Table 2)

// Model 1 (Testing Hypothesis 1)
// Random Intercept Logit Models 

xtlogit split single $CONTROLS, re
eststo model1: quietly xtlogit split single $CONTROLS, re

// Model 2 (Testing Hypothesis 2a)
xtlogit split i.single##c.evolatlag1 $CONTROLS, re
eststo model2: quietly xtlogit split i.single##c.evolatlag1 $CONTROLS, re

// Model 3 (Testing Hypothesis 2b)
xtlogit split c.incum_bef_dist##i.single $CONTROLS, re
eststo model3: quietly xtlogit split c.incum_bef_dist##i.single $CONTROLS, re

// Model 4 (Testing Hypothesis 3a and 3b)
xtlogit split coal_part coal_dist $CONTROLS, re
eststo model4: quietly xtlogit split coal_part coal_dist $CONTROLS, re

// Model 5 (Testing Hypothesis 3c)
xtlogit split c.coal_part##c.coal_dist $CONTROLS, re
eststo model5: quietly xtlogit split c.coal_part##c.coal_dist $CONTROLS, re

// Main Results Table 
esttab model1 model2 model3 model4 model5 using "table2.tex", replace b(2) se(2) label aic nogap ///  
nonumbers mtitle("I II III IV V") title("Subnational Unit Proliferation in Turkey, 1960--2018") star(* 0.1 ** 0.05 *** 0.01)


// Marginal Effects

mkdir marginplots

set graphics off

// Graph 1  - Model 2 
quietly xtlogit split i.single##c.evolatlag1 $CONTROLS

margins, at(single=(1) evolatlag1=(10(1)64)) post
est store margin1

set scheme white_tableau

marginsplot, recast(line) recastci(rarea) plotopts(lcolor(black) /// 
lwidth(medthick) lpattern(solid)) ciopts(fcolor(black%30) lcolor(gs10)) xsize(3) ysize(3) ytitle("") title("") 

graph save marginplots/figure1.gph, replace


// Graph 2 - Model 3
quietly xtlogit split c.incum_bef_dist##i.single $CONTROLS 

margins, at(single=(1) incum_bef_dist=(0(5)100)) post
est store margin2

set scheme white_tableau

marginsplot, recast(line) recastci(rarea) plotopts(lcolor(black) /// 
lwidth(medthick) lpattern(solid)) ciopts(fcolor(black%30) lcolor(gs10)) xsize(3) ysize(3) xlabel(0(20)100) ytitle("") title("") 

graph save marginplots/figure4.gph, replace

// Combining for Figure 3 in Main Text 

graph combine marginplots/figure1.gph marginplots/figure4.gph, ycommon l1("Probability of district split", size(small)) xsize(5) ysize(3)

graph save marginplots/figure3.gph, replace
graph export marginplots/figure3.svg, replace


// Graph 3 - Model 4
quietly xtlogit split c.coal_part##c.coal_dist $CONTROLS

margins, at(coal_dist=(0(2)56) coal_part=(2 5)) post
est store margin3

set scheme white_tableau

marginsplot, recast(line) recastci(rarea) plot1opts(lcolor(black) lpattern(dash)) ci1opts(lcolor(gs10) lpattern(solid) fcolor(black%30)) plot2opts(lcolor(black) lpattern(solid))  ci2opts(lcolor(gs10) lpattern(solid) fcolor(black%50)) ytitle("") title("") xsize(3) ysize(3) xlabel(0 10 20 30 40 50 56) legend(order (  3 "Small coalition" 4 "Large coalition") rows(2) position(10) ring(0))

graph save marginplots/figure7.gph, replace


// Graph 4 - Model 4
quietly xtlogit split c.coal_part##c.coal_dist $CONTROLS

margins, at(single=(0) coal_dist=(0(2)56)) post
est store margin4

set scheme white_tableau

marginsplot, recast(line) recastci(rarea) plotopts(lcolor(black) /// 
lwidth(medthick) lpattern(solid)) ciopts(fcolor(black%30) lcolor(gs10)) ///
xsize(3) ysize(3) xlabel(0 10 20 30 40 50 56) ytitle("") title("")

graph save marginplots/figure10.gph, replace

// Figure 4 in Main Text
graph combine marginplots/figure10.gph marginplots/figure7.gph, ycommon l1("Probability of district split", size(small)) xsize(5) ysize(3) 

graph save marginplots/figure4gph, replace
graph export marginplots/figure4.svg, replace


*********** END OF MARGINAL EFFECT PLOTS ************ 

// Figure 1 in the Paper 
// Maps in Abus and Ciftci (2025)

mkdir maps

set graphics off

unzipfile "tur_polbnda_adm2.zip", replace
spshape2dta tur_polbnda_adm2.shp, replace 

use "tur_polbnda_adm2.dta", clear
describe
destring _all, replace

use "tur_polbnda_adm2.dta", clear

//Generating key variables for merging later.
encode pcode, generate(dcode)
sort dcode
gen id = _n 

describe
save "tur_polbnda_adm2.dta", replace   

spset 
grmap

spset, modify coordsys(latlong, kilometers)

save "tur_polbnda_adm2.dta", replace

use "DistrictSplits.dta", clear
describe

encode pcode, generate(dcode)
gen id = _n // second key
describe

save "DistrictSplits.dta", replace

use "tur_polbnda_adm2.dta", clear
use "DistrictSplits.dta", clear    
           
merge 1:1 dcode id using "tur_polbnda_adm2.dta"
keep if _m==3
drop _m

grmap decade1, clnumber(2) clmethod(eqint) eirange(1 2) ndfcolor(white) fcolor(Set1) osize(vvthin) ndsize(vvthin) legend(order (1 "No Split" 2 "Mother" 3 "Splinter")) title("1960-1969")

graph save maps/map1color.gph, replace
graph export maps/map1color.svg, replace
graph export maps/map1color.png, replace

grmap decade1, clnumber(2) clmethod(eqint) eirange(1 2) ndfcolor(white) fcolor(Greys) osize(vvthin) ndsize(vvthin) legend(order (1 "No Split" 2 "Mother" 3 "Splinter")) title("1960-1969")

graph save maps/map1grey.gph, replace
graph export maps/map1grey.svg, replace
graph export maps/map1grey.png, replace

grmap decade2, clnumber(2) clmethod(eqint) eirange(1 2) ndfcolor(white) fcolor(Set1) osize(vvthin) ndsize(vvthin) legend(order (1 "No Split" 2 "Mother" 3 "Splinter")) title("1970-1979")

graph save maps/map2color.gph, replace
graph export maps/map2color.svg, replace
graph export maps/map2color.png, replace

grmap decade2, clnumber(2) clmethod(eqint) eirange(1 2) ndfcolor(white) fcolor(Greys) osize(vvthin) ndsize(vvthin) legend(order (1 "No Split" 2 "Mother" 3 "Splinter")) title("1970-1979")

graph save maps/map2grey.gph, replace
graph export maps/map2grey.svg, replace
graph export maps/map2grey.png, replace

grmap decade3, clnumber(2) clmethod(eqint) eirange(1 2) ndfcolor(white) fcolor(Set1) osize(vvthin) ndsize(vvthin) legend(order (1 "No Split" 2 "Mother" 3 "Splinter")) title("1980-1989")

graph save maps/map3color.gph, replace
graph export maps/map3color.svg, replace
graph export maps/map3color.png, replace

grmap decade3, clnumber(2) clmethod(eqint) eirange(1 2) ndfcolor(white) fcolor(Greys) osize(vvthin) ndsize(vvthin) legend(order (1 "No Split" 2 "Mother" 3 "Splinter")) title("1980-1989")

graph save maps/map3grey.gph, replace
graph export maps/map3grey.svg, replace
graph export maps/map3grey.png, replace

grmap decade4, clnumber(2) clmethod(eqint) eirange(1 2) ndfcolor(white) fcolor(Set1) osize(vvthin) ndsize(vvthin) legend(order (1 "No Split" 2 "Mother" 3 "Splinter")) title("1990-1999")

graph save maps/map4color.gph, replace
graph export maps/map4color.svg, replace
graph export maps/map4color.png, replace

grmap decade4, clnumber(2) clmethod(eqint) eirange(1 2) ndfcolor(white) fcolor(Greys) osize(vvthin) ndsize(vvthin) legend(order (1 "No Split" 2 "Mother" 3 "Splinter")) title("1990-1999")

graph save maps/map4grey.gph, replace
graph export maps/map4grey.svg, replace
graph export maps/map4grey.png, replace

grmap decade5, clnumber(2) clmethod(eqint) eirange(1 2) ndfcolor(white) fcolor(Set1) osize(vvthin) ndsize(vvthin) legend(order (1 "No Split" 2 "Mother" 3 "Splinter")) title("2000-2009")

graph save maps/map5color.gph, replace
graph export maps/map5color.svg, replace
graph export maps/map5color.png, replace

grmap decade5, clnumber(2) clmethod(eqint) eirange(1 2) ndfcolor(white) fcolor(Greys) osize(vvthin) ndsize(vvthin) legend(order (1 "No Split" 2 "Mother" 3 "Splinter")) title("2000-2009")

graph save maps/map5grey.gph, replace
graph export maps/map5grey.svg, replace
graph export maps/map5grey.png, replace

grmap decade6, clnumber(2) clmethod(eqint) eirange(1 2) ndfcolor(white) fcolor(Set1) osize(vvthin) ndsize(vvthin) legend(order (1 "No Split" 2 "Mother" 3 "Splinter")) title("2010-2018")

graph save maps/map6color.gph, replace
graph export maps/map6color.svg, replace
graph export maps/map6.png, replace

grmap decade6, clnumber(2) clmethod(eqint) eirange(1 2) ndfcolor(white) fcolor(Greys) osize(vvthin) ndsize(vvthin) legend(order (1 "No Split" 2 "Mother" 3 "Splinter")) title("2010-2018")

graph save maps/map6grey.gph, replace
graph export maps/map6grey.svg, replace
graph export maps/map6grey.png, replace

// Combining for Figure 1 in the Paper

set graphics on

graph combine maps/map1color.gph maps/map2color.gph ///
maps/map3color.gph maps/map4color.gph ///
maps/map5color.gph maps/map6color.gph , ///
graphregion(fcolor(white))  rows(3) altshrink  

graph save figure1color.gph, replace
graph export figure1color.svg, replace
graph export figure1color.png, replace

graph combine maps/map1grey.gph maps/map2grey.gph ///
maps/map3grey.gph maps/map4grey.gph ///
maps/map5grey.gph maps/map6grey.gph , ///
graphregion(fcolor(white))  rows(3) altshrink  

graph save figure1grey.gph, replace
graph export figure1grey.svg, replace
graph export figure1grey.png, replace

// Case Study Maps (Figure5)

use "Zonguldak.dta", replace

spset
grmap

spset, modify coordsys(latlong, kilometers)

use "Zonguldak.dta", clear
use "ZonguldakProliferation.dta", clear

merge 1:1 id using "Zonguldak.dta"

keep if _m==3
drop _m

grmap year, clnumber(3) clmethod(custom) clbreaks(1987 1989 1990 2012) ndfcolor(white) fcolor(OrRd) osize(vvthin) ndsize(vvthin) legend(order (1 "No Split" 2 "1987" 3 "1990" 4 "2012")) 

graph save figure5a.gph, replace

grmap pr_id, clnumber(3)  clbreaks(0 1 2 3 4) ndfcolor(white) fcolor(OrRd) osize(vvthin) ndsize(vvthin) legend(order (2 "Zonguldak" 3 "Bartin" 4 "Karabuk"))

graph save  figure5b.gph, replace


unzipfile "tur_polbnda_adm1.zip", replace

spshape2dta tur_polbnda_adm1, replace 

use "tur_polbnda_adm1.dta", clear

sort adm1
gen id = _n 
rename adm1 pcode

describe
save "tur_polbnda_adm1.dta", replace   

spset 
grmap

spset, modify coordsys(latlong, kilometers)

save "tur_polbnda_adm1.dta", replace


use "Zonguldakarea.dta", clear

describe
gen id = _n
save "Zonguldakarea.dta", replace


use "tur_polbnda_adm1.dta", clear

use "Zonguldakarea.dta", clear    

           
merge 1:1 pcode id using "tur_polbnda_adm1.dta"

drop _merge

grmap zonguldak, fcolor(gs8) osize(vvthin) ndsize(vvthin) ndfcolor(white) legenda(off)

graph save figure5c.gph, replace

graph combine figure5a.gph figure5b.gph figure5c.gph, rows(2) altshrink


graph save figure5.gph, replace
graph export figure5.svg, replace


// APPENDIX ROBUSTNESS CHECKS
// A.1 
use "UnitProliferation.dta", clear

xtset district_id year

foreach k in 28 106 108 114 126 176 181 194 196 200 241 246 255 291 297 322 340 343 355 385 451 470 471 495 519 520 547 553 576 582 591 630 633 636 637 641 642 649 651 654 658 659 661 663 668 670 671 672 673 683 686 688 820 919 923 946 {
	drop if district_id == `k'
}

eststo model6: quietly xtlogit split single $CONTROLS

eststo model7: quietly xtlogit split i.single##c.evolatlag1 $CONTROLS

eststo model8: quietly xtlogit split c.incum_bef_dist##i.single $CONTROLS

eststo model9: quietly xtlogit split coal_part coal_dist $CONTROLS

eststo model10: quietly xtlogit split c.coal_part##c.coal_dist $CONTROLS

// Main Results Table 
esttab model6 model7 model8 model9 model10 using "apptable1.tex", replace b(2) se(2) label aic nogap ///  
nonumbers mtitle("I II III IV") title("Administrative Unit Proliferation in Turkey, 1960--2018") star(* 0.1 ** 0.05 *** 0.01)


// A.2
use "UnitProliferation.dta", clear

xtset district_id year

foreach k in 27 69 79 83 85 178 245 330 409 427 532 562 622 752 915 960 966  {
	drop if district_id == `k'
}

eststo model11: quietly xtlogit split single $CONTROLS

eststo model12: quietly xtlogit split i.single##c.evolatlag1 $CONTROLS

eststo model13: quietly xtlogit split c.incum_bef_dist##i.single $CONTROLS

eststo model14: quietly xtlogit split coal_part coal_dist $CONTROLS

eststo model15: quietly xtlogit split c.coal_part##c.coal_dist $CONTROLS

// Main Results Table 
esttab model11 model12 model13 model14 model15 using "apptable2.tex", replace b(2) se(2) label aic nogap ///  
nonumbers mtitle("I II III IV") title("Administrative Unit Proliferation in Turkey, 1960--2018") star(* 0.1 ** 0.05 *** 0.01)


// A.3
use "UnitProliferation.dta", clear

xtset district_id year

foreach k in 27 28 69 79 83 85 106 108 114 126 176 178 181 194 196 200 241 245 246 255 291 297 322 330 340 343 355 385 409 427 451 470 471 495 519 520 532 547 553 562 576 582 591 622 630 633 636 637 641 642 649 651 654 658 659 661 663 668 670 671 672 673 683 686 688 752 820 915 919 923 946 960 966 {
	drop if district_id == `k'
}


eststo model16: quietly xtlogit split single $CONTROLS

eststo model17: quietly xtlogit split i.single##c.evolatlag1 $CONTROLS

eststo model18: quietly xtlogit split c.incum_bef_dist##i.single $CONTROLS

eststo model19: quietly xtlogit split coal_part coal_dist $CONTROLS

eststo model20: quietly xtlogit split c.coal_part##c.coal_dist $CONTROLS


// Main Results Table 
esttab model16 model17 model18 model19 model20 using "apptable3.tex", replace b(2) se(2) label aic nogap ///  
nonumbers mtitle("I II III IV") title("Administrative Unit Proliferation in Turkey, 1960--2018") star(* 0.1 ** 0.05 *** 0.01)


// A.4
use "UnitProliferation.dta", clear

xtset district_id year

eststo model21: quietly xtlogit split i.single##c.evolatlag2 disprop margin lagright splitbefore ruralshare kurddist ethnicparty lnpop age trend

esttab model21 using "apptable4.tex", replace b(2) se(2) label aic nogap nonumbers mtitle("I II III IV") title("Administrative Unit Proliferation in Turkey, 1960--2018") star(* 0.1 ** 0.05 *** 0.01)


// A.5
use "UnitProliferation.dta", clear

xtset district_id year

eststo model22: quietly xtlogit split single $CONTROLS gdp

eststo model23: quietly xtlogit split i.single##c.evolatlag1 $CONTROLS gdp

eststo model24: quietly xtlogit split c.incum_bef_dist##i.single $CONTROLS gdp

eststo model25: quietly xtlogit split coal_part coal_dist $CONTROLS gdp

eststo model26: quietly xtlogit split c.coal_part##c.coal_dist $CONTROLS gdp

// Main Results Table 
esttab model22 model23 model24 model25 model26 using "apptable5.tex", replace b(2) se(2) label aic nogap ///  
nonumbers mtitle("I II III IV") title("Administrative Unit Proliferation in Turkey, 1960--2018") star(* 0.1 ** 0.05 *** 0.01)

// A.6
use "UnitProliferation.dta", clear

xtset district_id year

eststo model27: quietly xtlogit split c.coal_part##c.coal_dist_s evolatlag1 disprop margin lagright splitbefore  kurddist ethnicparty ruralshare lnpop age trend

esttab model27 using "apptable6.tex", replace b(2) se(2) label aic nogap nonumbers mtitle("IV") title("Administrative Unit Proliferation in Turkey, 1960--2018") star(* 0.1 ** 0.05 *** 0.01)

// A.7
use "UnitProliferation.dta", clear

xtset district_id year

eststo model28: quietly xtlogit split single $CONTROLS logist

eststo model29: quietly xtlogit split i.single##c.evolatlag1 $CONTROLS logist

eststo model30: quietly xtlogit split c.incum_bef_dist##i.single $CONTROLS logist

eststo model31: quietly xtlogit split coal_part coal_dist $CONTROLS logist

eststo model32: quietly xtlogit split c.coal_part##c.coal_dist $CONTROLS logist

esttab model28 model29 model30 model31 model32 using "apptable7.tex", replace b(2) se(2) label aic nogap ///  
nonumbers mtitle("I II III IV") title("Administrative Unit Proliferation in Turkey, 1960--2018") star(* 0.1 ** 0.05 *** 0.01)

// A.8
use "UnitProliferation.dta", clear

xtset district_id year

eststo model33: quietly xtlogit split single evolatlag1 disprop margin lagright splitbefore ruralshare kurddist ethnicparty lnpop age decade

eststo model34: quietly xtlogit split i.single##c.evolatlag1 disprop margin lagright splitbefore ruralshare kurddist ethnicparty lnpop age decade

eststo model35: quietly xtlogit split disprop margin lagright c.incum_bef_dist##i.single evolatlag1 splitbefore kurddist ethnicparty ruralshare lnpop age decade 

eststo model36: quietly xtlogit split coal_part coal_dist disprop evolatlag1 margin lagright splitbefore kurddist ethnicparty ruralshare lnpop age decade

eststo model37: quietly xtlogit split c.coal_part##c.coal_dist evolatlag1 disprop margin lagright splitbefore  kurddist ethnicparty ruralshare lnpop age decade

esttab model33 model34 model35 model36 model37 using "apptable8.tex", replace b(2) se(2) label aic nogap ///  
nonumbers mtitle("I II III IV") title("Administrative Unit Proliferation in Turkey, 1960--2018") star(* 0.1 ** 0.05 *** 0.01)

// A.9 Controlling for GDP Growth

xtset district_id year

eststo model38: quietly xtlogit split single $CONTROLS gdpgrowth

eststo model39: quietly xtlogit split i.single##c.evolatlag1 $CONTROLS gdpgrowth

eststo model40: quietly xtlogit split c.incum_bef_dist##i.single $CONTROLS gdpgrowth

eststo model41: quietly xtlogit split coal_part coal_dist $CONTROLS gdpgrowth

eststo model42: quietly xtlogit split c.coal_part##c.coal_dist $CONTROLS gdpgrowth

// Main Results Table 
esttab model38 model39 model40 model41 model42 using "apptable9.tex", replace b(2) se(2) label aic nogap ///  
nonumbers mtitle("I II III IV") title("Administrative Unit Proliferation in Turkey, 1960--2018") star(* 0.1 ** 0.05 *** 0.01)


//A.10 Robust Standard Errors Clustered by Election Year

use "UnitProliferation.dta", clear

eststo model43: quietly melogit split single $CONTROLCLUSTER, vce(cluster year)

eststo model44: quietly melogit split i.single##c.evolatlag1 $CONTROLCLUSTER, vce(cluster year)

eststo model45: quietly melogit split c.incum_bef_dist##i.single $CONTROLCLUSTER, vce(cluster year)

eststo model46: quietly melogit split coal_part coal_dist $CONTROLCLUSTER, vce(cluster year)

eststo model47: quietly melogit split c.coal_part##c.coal_dist $CONTROLCLUSTER, vce(cluster year)

esttab model43 model44 model45 model46 model47 using "apptable10.tex", replace b(2) se(2) label aic nogap ///  
nonumbers mtitle("I II III IV V") title("Subnational Unit Proliferation in Turkey, 1960--2018") star(* 0.1 ** 0.05 *** 0.01)


// Appendix Figure 1
// Map Showing the Excluded Districts for the Robustness Checks

unzipfile "tur_polbnda_adm2.zip", replace
spshape2dta tur_polbnda_adm2.shp, replace 


use "tur_polbnda_adm2.dta", clear
describe
destring _all, replace

use "tur_polbnda_adm2.dta", clear

//Generating key variables for merging later.
encode pcode, generate(dcode)
sort dcode
gen id = _n 

describe
save "tur_polbnda_adm2.dta", replace   

spset 
grmap

spset, modify coordsys(latlong, kilometers)

save "tur_polbnda_adm2.dta", replace

use "DistrictSplits.dta", clear
describe

encode pcode, generate(dcode)
gen id = _n // second key
describe

save "DistrictSplits.dta", replace

use "tur_polbnda_adm2.dta", clear
use "DistrictSplits.dta", clear    
           
merge 1:1 dcode id using "tur_polbnda_adm2.dta"
keep if _m==3
drop _m

grmap multisplit, clnumber(2) clmethod(eqint) eirange(1 2) ndfcolor(white) fcolor(Set1) osize(vvthin) ndsize(vvthin) legend(order (2 "Split Multiple Times" 3 "Splinter then Mother")) 

graph save appendixfigure.gph, replace
graph export appendixfigure.svg, replace


// Appendix Table 9 (C)
summ single coal evolatlag1 incum_bef_dist coal_part coal_dist coal_dist_s disprop margin lagright split splitbefore age kurddist ethnicparty ruralshare lnpop trend  gdp logist decade 


***************************END OF DO-FILE********************************
